package com.fudan.adse.service.impl;

import com.fudan.adse.dao.RoleDao;
import com.fudan.adse.domain.po.Menu;
import com.fudan.adse.domain.po.Resource;
import com.fudan.adse.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDao roleDao;

    @Override
    public List<Menu> getMenuList(Integer userId) {
        return roleDao.getMenuList(userId);
    }

    @Override
    public List<Menu> listMenu(Integer roleId) {
        return roleDao.getMenuListByRoleId(roleId);
    }

    @Override
    public List<Resource> listResource(Integer roleId) {
        return roleDao.getResourceListByRoleId(roleId);
    }
}
